//如果Type是Button
if (sender.GetType().Name.Equals("Button"))
{
Button btn = (Button)sender;
switch (btn.Name)
{
case "btn_0":
case "btn_1":
case "btn_2":
case "btn_3":
case "btn_4":
case "btn_5":
case "btn_6":
case "btn_7":
case "btn_8":
case "btn_9":
if (InputValue.Length >= 20) break;
checkClear();
InputValue += btn.Text;
break;
...
}
}
//如果Type是PictureBox
else
{
this.Visible = false;
}